package com.nexus.service.sys.service.mapstruct;


import com.nexus.core.service.mapstruct.BaseConverter;
import com.nexus.core.sys.dto.SysOfficeDTO;
import com.nexus.core.sys.dto.SysOrgMenuDTO;
import com.nexus.core.sys.entity.SysOffice;
import com.nexus.core.sys.entity.SysOrgMenu;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

/**
 * SysOrgMenuWrapper
 *
 * @author luzhengning
 * @version 2024-04-19
 */
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
public interface SysOrgMenuWrapper extends BaseConverter<SysOrgMenu, SysOrgMenuDTO> {

    SysOrgMenuWrapper INSTANCE = Mappers.getMapper(SysOrgMenuWrapper.class);

    @Mappings({
            @Mapping(source = "org.id", target = "org"),
            @Mapping(source = "menu.id", target = "menu"),
            @Mapping(source = "createBy.id", target = "createBy"),
            @Mapping(source = "updateBy.id", target = "updateBy")})
    SysOrgMenu toEntity(SysOrgMenuDTO dto);

    @Mappings({
            @Mapping(source = "org", target = "org.id"),
            @Mapping(source = "menu", target = "menu.id"),
            @Mapping(source = "createBy", target = "createBy.id"),
            @Mapping(source = "updateBy", target = "updateBy.id")})
    SysOrgMenuDTO toDTO(SysOrgMenu entity);
}

